<template>
  <div class="list-item" @click="jump">
    <div class="video-image">
      <img v-lazy="item.image" alt="">
    </div>
    <div class="video-message">
      <div class="title">{{ item.title }}</div>
      <div class="author">{{ item.publisher }}</div>
      <div class="play-msg">
        <div class="icon-wrap play-count">
          <span class="iconfont icon-bofangliang"></span>
          <div>{{ item.playCount }}</div>
        </div>
        <div class="publish-time">{{ item.publishTime }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
  const props = defineProps({
    item: { type: Object, default: () => ({}) }
  })

  const emit = defineEmits('jump');

  //  点击跳转
  const jump = () => {
    emit('jump');
  }
</script>

<style lang="scss" scoped>
.list-item {
  display: flex;
  padding: 1rem;
  margin-bottom: 1rem;
  height: 9rem;
  border-radius: 1rem;
  box-sizing: border-box;
  background: #fff;

  .video-image {
    width: 11rem;
    border-radius: .8rem;
    overflow: hidden;
    box-sizing: border-box;

    img {
      width: 100%;
      height: 100%;
    }
  }

  .video-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 1rem;

    .title {
      font-size: 1.4rem;
    }

    .author {
      font-size: 1.2rem;
      color: #777;
    }

    .play-msg {
      position: relative;
      width: 100%;
      display: flex;
      align-items: center;

      .icon-wrap {
        display: flex;
        align-items: center;
        font-size: 1rem;
        margin-right: 1rem;

        .iconfont {
          padding-right: .4rem;
          font-size: 1rem;

          &.icon-guankanrenshu {
            font-size: 1rem;
          }
        }
      }

      .publish-time {
        position: absolute;
        right: 0;
        font-size: 1rem;
      }
    }
  }
}
</style>